#include<iostream>
using namespace std;
class Shape
{
protected:
    int width;
    int length;
public:
    Shape(int wid=0,int len=0)
    {
        width=wid;
        length=len;
    }
    virtual int getArea()=0;
};
class Rectangle:public Shape
{
    public:
        Rectangle(int wid=0,int len=0):Shape(wid,len){}
        int getArea()
        {
            return width*length;
        }
};
class Triangle:public Shape
{
    public:
    Triangle(int wid,int len):Shape(wid,len){}
        int getArea()
        {
            return (width*length)/2;
        }
};
int main()
{
    Rectangle Rect(12,4);
    Triangle Tri(4,7);
    cout<<"total rectangle area:"<<Rect.getArea()<<endl;
    cout<<"total triangle area:"<<Tri.getArea()<<endl;
}
